home *** CD-ROM | disk | FTP | other *** search
-
-
-
- pbm(3) PBM Plus pbm(3)
-
-
-
- NAME
- pbm - functions to support portable bitmap programs
-
- SYNOPSIS
- #include <pbm.h>
- cc ... libpbm.a
-
-
- DESCRIPTION
- TYPES AND CONSTANTS
-
- typedef unsigned char bit;
- #define PBM_WHITE 0
- #define PBM_BLACK 1
-
- Each _b_i_t should contain only the values of _w_h_i_t_e or _b_l_a_c_k.
-
- PBM MEMORY MANAGEMENT
-
- bit **pbm_allocarray(int cols, int rows)
-
- Allocate an array of bits.
-
- bit *pbm_allocrow( int cols )
-
- Allocate a row of the given number of bits.
-
- void pbm_freearray( bitrow, rows )
-
- Free the array allocated with _p_b_m__a_l_l_o_c_a_r_r_a_y() containing
- the given number of rows.
-
- pbm_freerow( bitrow )
-
- Free a row of bits.
-
- READING PBM FILES
-
- void
- pbm_readpbminit( file, colsP, rowsP, formatP )
- FILE *file;
- int *colsP, *rowsP, *formatP;
-
- Read the header from a pbm file, filling in the rows, cols
- and format variables.
-
- void
- pbm_readpbmrow( file, bitrow, cols, format )
- FILE *file;
- bit *bitrow;
- int cols, format;
-
-
-
-
- Printed 5/25/90 1
-
-
-
-
-
-
- pbm(3) PBM Plus pbm(3)
-
-
-
- Read a row of bits into the bitrow array. Format and cols
- were filled in by _p_b_m__r_e_a_d_p_b_m_i_n_i_t().
-
- bit **
- pbm_readpbm( file, colsP, rowsP )
- FILE *file;
- int *colsP, *rowsP;
-
- Read an entire bitmap file into memory, returning the allo-
- cated array and filling in the rows and cols variables.
- This function combines _p_b_m__r_e_a_d_p_b_m_i_n_i_t(), _p_b_m__a_l_l_o_c_a_r_r_a_y()
- and _p_b_m__r_e_a_d_p_b_m_r_o_w().
-
- WRITING PBM FILES
-
- void
- pbm_writepbminit( file, cols, rows )
- FILE *file;
- int cols, rows;
-
- Write the header for a portable bitmap file.
-
- void
- pbm_writepbmrow( file, bitrow, cols )
- FILE *file;
- bit *bitrow;
- int cols;
-
- Write a row from a portable bitmap.
-
- void
- pbm_writepbm( file, bits, cols, rows )
- FILE *file;
- bit **bits;
- int cols, rows;
-
- Write the header and all data for a portable bitmap. This
- function combines _p_b_m__w_r_i_t_e_p_b_m_i_n_i_t() and _p_b_m__w_r_i_t_e_p_b_m_r_o_w().
-
- SEE ALSO
- pgm(3), ppm(3)
-
- AUTHOR
- Manual by Tony Hansen.
-
- Copyright (C) 1989 by Jef Poskanzer.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
-
-
-
- Printed 5/25/90 2
-
-
-
-
-
-
- pbm(3) PBM Plus pbm(3)
-
-
-
- documentation. This software is provided "as is" without
- express or implied warranty.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Printed 5/25/90 3
-
-
-
-